var example;
$(document).ready(function () {

    var data = [];
    $("#example > tbody > tr").each(function (i, row) {
        var cells = $(row).find("td");
        data[i] = {
            "name": cells[0].innerText,
            "position": cells[1].innerText,
            "office": cells[2].innerText,
            "age": cells[3].innerText,
            "startDate": cells[4].innerText,
            "salary": cells[5].innerText
        }
    });
    // console.log(JSON.stringify({data: data}));

    example = $('#example').DataTable({
        "rowCallback": function( row, data, index ) {
           console.dir(arguments);
        }
    });

    $("#clearTable").on('click', example, function () {
        example.clear().draw();
    })


});